﻿using CardGameCore.Common;

namespace CardGameCore.Battle
{
    public class HorizontalFinder : IHorizontalFinder
    {
        public bool TryGetHorizontalCard(Actor actor, Vector2Int position, out object card)
        {
            card = null;
            foreach (var pos in actor.BattleCards.Keys)
            {
                if (position.Y == pos.Y)
                {
                    card = actor.BattleCards[pos];
                    return true;
                }
            }

            return false;
        }
    }
}